package org.enlongWu.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.enlongWu.pojo.Article;
import org.enlongWu.pojo.Message;

import java.util.List;

@Mapper
public interface MessageMapper {
    //新增消息记录
    void add(Message message);


    List<Message> list(Integer userId, Integer messageType, String state);

    @Select("select * from message where id = #{id}")
    Message searchById(Integer id);

    void setRead(Integer id);

    List<Message> applicationGroupBySendTime(Integer senderId);

    @Delete("delete from message where id = #{id}")
    int delete(Integer id);

    @Delete("delete from message where message_type=1 and content=#{applicationId}")
    int deleteByContent(String applicationId);
}
